<?php  //这是QQ群的发信方法
function send_post($url, $post_data ,$cookie) {
    $postdata = http_build_query($post_data);
    $options = array(
        'http' => array(
            'method' => 'POST',
            'header' => array(
                'Content-type:application/x-www-form-urlencoded',
                "Cookie:$cookie",
                'Referer:http://d1.web2.qq.com/cfproxy.html?v=20151105001&callback=1',
            ),
            'content' => $postdata,
            'timeout' => 15 * 60 // 超时时间（单位:s）
        )
    );
    $context = stream_context_create($options);
    $result = file_get_contents($url, false, $context);
    
    return $result;
}

//使用方法
$root = $_SERVER['DOCUMENT_ROOT'];
$fp1 = fopen("$root/txt", 'r+');
$id = fgetc($fp1);
fclose($fp1);
$id = $id+1;
$fp2 = fopen("$root/txt", 'r+');
fwrite($fp2,$id);
fclose($fp2);
$time =90680000+$id;
$cookie1 ="";//此处填写cookie
$psessionid ="8368046764001d636f6e6e7365727665725f77656271714031302e3133332e34312e383400001ad00000066b026e040015808a206d0000000a406172314338344a69526d0000002859185d94e66218548d1ecb1a12513c86126b3afb97a3c2955b1070324790733ddb059ab166de6857";
$groupid ="";//此处填写群id
$content =$_GET['content'];//可用get方法请求
$post_data = array(
    'r' => '{"group_uin":'.$groupid.',"content":"[\"'.$content.'\",[\"font\",{\"name\":\"宋体\",\"size\":10,\"style\":[0,0,0],\"color\":\"000000\"}]]","face":585,"clientid":53999199,"msg_id":'.$time.',"psessionid":"'.$psessionid.'"}',
);
$result1 = send_post('http://d1.web2.qq.com/channel/send_qun_msg2',$post_data,$cookie1);
echo $result1;